package org.huangrui.redis.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.huangrui.redis.service.HyperLogLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author hr
 * @Create 2024-05-15 14:20
 */
@Slf4j
@RestController
@Tag(name = "淘宝亿级UV的Redis统计方案")
public class HyperLogLogController {
    @Autowired
    private HyperLogLogService hyperLogLogService;

    @GetMapping("/uv")
    @Operation(summary = "获得IP去重复后的UV统计访问量")
    public long uv(){
        return hyperLogLogService.uv();
    }
}
